#ifndef __SYSDEP_H_INCLUDE__
#define __SYSDEP_H_INCLUDE__

/* $Id: sysdep.h 150 2009-06-17 13:52:15Z zealcook@gmail.com $ */

#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>

/* calc project basic header */
#include <log.h>

#ifdef WIN32
#include <io.h>		/* open() */
#include <getopt.h>
#else
#include <unistd.h>
#endif

#ifdef WIN32
#pragma warning (disable: 4047)
#define fsync		_commit
#define vsnprintf	_vsnprintf
#define snprintf	_snprintf
#define strcasecmp	_stricmp
#define strncasecmp	_strnicmp
#define ssize_t		size_t

#endif

/* basic type length */
#ifndef WIN32
typedef unsigned char 		uint8_t;	/* one byte */
typedef unsigned short 		uint16_t;	/* two byte */
typedef unsigned long 		uint32_t;	/* four byte */
typedef unsigned long long 	uint64_t;	/* eigth byte */
#else
typedef unsigned __int8		uint8_t;	/* one byte */
typedef unsigned __int16	uint16_t;	/* two bytes */
typedef unsigned __int32	uint32_t;	/* four bytes */
typedef unsigned __int64	uint64_t;	/* eight bytes */
#endif

#endif /* __SYSDEP_H_INCLUDE__ */
